import React from "react";
import Layout from "../components/layout";

const Home = React.lazy(() => import("../views/home"));
const List = React.lazy(() => import("../views/list"));
const Listadd = React.lazy(() => import("../views/listAdd"));
const Set = React.lazy(() => import("../views/set"));

const Login = React.lazy(() => import("../views/login"));

export const staticRoutes = [
  {
    path: "/login",
    element: <Login></Login>,
    meta: {
      title: "登录",
    },
  },
];
export const siderRoutes = [
  {
    path: "/",
    element: (
      <Layout>
        <Home></Home>
      </Layout>
    ),
    meta: {
      title: "首页",
    },
  },
  {
    path: '/list',
    meta: {
      title: "数据管理",
    },
    children: [
      {
        path: "/list",
        element: (
          <Layout>
            <List></List>
          </Layout>
        ),
        meta: {
          title: "列表管理",
        },
      },
      {
        path: "/list/add",
        element: (
          <Layout>
            <Listadd></Listadd>
          </Layout>
        ),
        meta: {
          title: "列表添加",
        },
      },
    ]
  },
  {
    path: "/set",
    element: (
      <Layout>
        <Set></Set>
      </Layout>
    ),
    meta: {
      title: "设置",
    },
  },
];

export const routes = staticRoutes.concat(siderRoutes);
